package cn.tedu.bece.front.controller;

import cn.tedu.bece.front.common.response.JsonResult;
import cn.tedu.bece.front.pojo.dto.KnowledgeCategoryQuery;
import cn.tedu.bece.front.pojo.vo.KnowledgeCategoryVO;
import cn.tedu.bece.front.service.KnowledgeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/Knowledge")
public class KnowledgeController {
    @Autowired
    KnowledgeService knowledgeService;

    @GetMapping("/selectKnowledgeCategory")
    public JsonResult selectKnowledgeCategory(KnowledgeCategoryQuery knowledgeCategoryQuery){
        log.debug("查询知识分类列表：knowledgeCategoryQuery={}",knowledgeCategoryQuery);
        List<KnowledgeCategoryVO> list = knowledgeService.selectKnowledgeCategory(knowledgeCategoryQuery);
        return JsonResult.success(list);
    }
}
